﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DusonFramework.Utils.Mail
{
    public abstract class EmailProvider
    {
        string _name;
        string _smtpServer = "localhost";
        int _port;
        string _password;
        string _userName;
        string _adminEmail;

        #region 属性
        public string AdminEmail
        {
            get
            {
                return _adminEmail;
            }
            set
            {
                _adminEmail = value;
            }
        }

        public string SmtpServer
        {
            get
            {
                if (_smtpServer == null || _smtpServer.Length == 0)
                    _smtpServer = "localhost";
                return _smtpServer;
            }
            set
            {
                _smtpServer = value;
            }
        }

        public int Port
        {
            get { return this._port; }
            set { this._port = value; }
        }


        public string Password
        {
            get
            {
                return _password;
            }
            set
            {
                _password = value;
            }
        }

        public string UserName
        {
            get
            {
                return _userName;
            }
            set
            {
                _userName = value;
            }
        }

        public string Name
        {
            get
            {
                return _name;
            }
        }
        #endregion

        #region 方法
        public abstract bool Send(string to, string from, string subject, string message);
        #endregion

    }
}
